package com.cskaoyan.config;

import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

/**
 * @author zhangminghui
 * @date 2022/8/5
 */
public class WebApplicationInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
    // todo: ContextLoaderListener会加载该方法的返回值，
    //  初始化WebApplicationContext容器
    @Override
    protected Class<?>[] getRootConfigClasses() {
        //return new Class[0];
        return new Class[]{MybatisConfiguration.class};
    }

    // todo: DispatcherServlet会加载方方法的返回值，
    //  初始化WebApplicationContext容器
    @Override
    protected Class<?>[] getServletConfigClasses() {
        //return new Class[0];
        return new Class[]{MvcConfiguration.class};
    }

    // todo: 配置DispatcherServlet的映射范围 /
    @Override
    protected String[] getServletMappings() {
        //return new String[0];
        return new String[]{"/"};
    }
}
